<script setup lang="ts">
import { ref } from "vue";
import IndexApi from "../api/index";
import hljs from "highlight.js/lib/common";
import "highlight.js/styles/atom-one-dark.css";
const params = new URLSearchParams(window.location.search);
const content: any = ref([]);
const loadData = () => {
    IndexApi.find({ id: params.get("id"), index: params.get("index") }).then((res: any) => {
        content.value = hljs.highlightAuto(res.data || "").value;
    });
};
loadData();
</script>
<template>
    <div class="w-screen h-screen">
        <el-scrollbar class="w-full h-full">
            <pre class="text-sm p-2 leading-7 mt-1 whitespace-pre-wrap">
                <code v-html="content"></code>
            </pre>
        </el-scrollbar>
    </div>
</template>
<style scoped>
</style>
